#include "geom.h"
#include "export.h"
Go to the source code of this file.
Enumerator |
---|
LOW_RES |
|
MED_RES |
|
HIGH_RES |
|
NATIVE_RES |
|
EXPORT_SYM int camera_load_config |
( |
const char * |
name) | |
|
Loads the config file specified by name.
- Parameters
-
name | The configuration to load. Configuration file names are case sensitive. |
- Note
- You must include the config file extension ".conf" in the name parameter.
- Returns
- 1 on success, 0 on failure.
Opens the default system camera for use.
- Parameters
-
res | The resolution the camera should operate at. This can be:
- LOW_RES (160x120)
- MED_RES (320x240)
- HIGH_RES (640x480)
|
- Returns
- 1 on success, 0 on failure
- See Also
- camera_open_device
-
camera_close
Opens a camera for use.
- Parameters
-
number | The camera's id. 0 is the first camera, 1 is the second camera, etc. |
res | The resolution the camera should operate at. This can be:
- LOW_RES (160x120)
- MED_RES (320x240)
- HIGH_RES (640x480)
|
- Returns
- 1 on success, 0 on failure
- See Also
- camera_open
-
camera_close
Pulls a new image from the camera for processing.
- Returns
- 1 on success, 0 on failure.
EXPORT_SYM const unsigned char* get_camera_frame |
( |
) | |
|
EXPORT_SYM const unsigned char* get_camera_frame_row |
( |
unsigned |
row) | |
|
Retrieves the current camera frame row as a BGR (BGR888) array. The returned pointer is invalid after camera_update() is called again.
- Returns
- the current BGR888 camera frame row.
Gets the camera's y resolution.
- Attention
- This value might be different than the previously set y resolution. Never assume the y resolution.
- Returns
- The camera's y resolution, in pixels.
- Parameters
-
p | The point at which the pixel lies. |
- Returns
- The rgb value of the pixel located at point p.
- Note
- A (r, g, b) value of (-1, -1, -1) will be returned for points that are out of range.
Gets the camera's x resolution.
- Attention
- This value might be different than the previously set x resolution. Never assume the x resolution.
- Returns
- The camera's x resolution, in pixels.
- Returns
- Number of channels in the current configuration.
- See Also
- get_object_count
EXPORT_SYM int get_code_num |
( |
int |
channel, |
|
|
int |
object |
|
) |
| |
- Returns
- The data associated with the given channel and object as an integer. If the given channel or object doesn't exist, -1 is returned.
- See Also
- get_object_data
EXPORT_SYM int get_object_area |
( |
int |
channel, |
|
|
int |
object |
|
) |
| |
- Returns
- The object's bounding box area. -1 is returned if the channel or object doesn't exist.
- Returns
- The bounding box of the given object on the given channel.
- Returns
- The (x, y) center of the given object on the given channel.
- Returns
- The (x, y) centroid of the given object on the given channel.
EXPORT_SYM double get_object_confidence |
( |
int |
channel, |
|
|
int |
object |
|
) |
| |
- Returns
- The confidence, between 0.0 and 1.0, that given object on the given channel is significant. If the channel or object doesn't exist, 0.0 is returned.
- Parameters
-
channel | The channel to scan for objects. |
- Note
- Objects are sorted by area, largest first.
- Returns
- Number of objects in the given channel, -1 if channel doesn't exist.
- See Also
- get_channel_count
EXPORT_SYM const char* get_object_data |
( |
int |
channel, |
|
|
int |
object |
|
) |
| |
- Returns
- The string data associated with a given object on a given channel. If there is no data associated, 0 is returned.
- Note
- This data is not guaranteed to be null terminated.
-
This string pointer will be invalid after a call to camera_update()
- See Also
- get_object_data_length
EXPORT_SYM int get_object_data_length |
( |
int |
channel, |
|
|
int |
object |
|
) |
| |
- Returns
- The length of the string data associated with a given object on a given channel. If there is no data associated, 0 is returned. If the channel or object is invalid, 0 is returned.
- See Also
- get_object_data
EXPORT_SYM void set_camera_config_base_path |
( |
const char *const |
path) | |
|
Sets the path in which to look for camera configurations.
- Parameters
-
path | the absolute directory path in which to look for camera configurations. |
Sets the camera's y resolution.
- Parameters
-
width | The height in pixels |
Sets the camera's x resolution.
- Parameters
-